#ifndef FHE_PRIMS_CAMERA_H
#define FHE_PRIMS_CAMERA_H

#include <fhe/prims/IRenderable.h>
#include <fhe/prims/IRenderContext.h>
#include <fhe/math/Vec.h>
#include <fhe/core/Node.h>

namespace fhe
{
  namespace core
  {
    template <size_t D, typename T>
    class Camera : public Node, public IRenderable<D,T>
    {
    public:
      Camera()
        : position( 0, 0, 0 )
        , lookAt( 0, 0, 1 )
      {
      }
      
      virtual ~Camera()
      {
      }
      
      Vec<D,T> position;
      Vec<D,T> lookAt;
      Vec<D,T> up;
      
      virtual void render( IRenderContext<D,T>* rc )
      {
        rc->lookAt( position, lookAt, up );
      }
      
      virtual void unrender( IRenderContext<D,T>* rc )
      {
        rc->popTransform();
      }
    };
    
    typedef Camera<3,double> Camera3d;
  }
}

#endif
